﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BOM.dao;
using BOM.BaseData;

namespace BOM.SysAdmin
{
    public partial class ParamList : Form
    {
        public ParamList()
        {
            InitializeComponent();
        }
        //新增按钮
        private void btnAddNew_Click(object sender, EventArgs e)
        {

        }
        //窗体的加载事件
        private void ParamList_Load(object sender, EventArgs e)
        {
            Loadingdataview();//加载datagridview控件
            btnAddNew.Enabled = false;
            btnRemove.Enabled = false;
        }
        //退出按钮
        private void btnQuit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        //查看按钮
        private void btnView_Click(object sender, EventArgs e)
        {
            CustomerList.XuanZID = Convert.ToInt32(dataGridView1.CurrentRow.Cells["id"].Value);
            ParamForm form = new ParamForm();
            form.Owner = this;
            form.ShowDialog();
        }
        //加载datagridview控件
        public void Loadingdataview()
        {
            DataTable table = ParamNew.SelectParam();
            dataGridView1.DataSource = table;
        }
        //编辑按钮
        private void btnEdit_Click(object sender, EventArgs e)
        {
            CustomerList.XuanZID = Convert.ToInt32(dataGridView1.CurrentRow.Cells["id"].Value);
            ParamForm form = new ParamForm();
            form.Owner = this;
            form.ShowDialog();
        }
        
        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            
        }
        //双击单元格发生
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            CustomerList.XuanZID = Convert.ToInt32(dataGridView1.CurrentRow.Cells["id"].Value);
            ParamForm form = new ParamForm();
            form.Owner = this;
            form.ShowDialog();
        }
    }
}
